package oop2;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class ClsTest {
    public static void main(String[] args) {
        JavaClass n = new JavaClass();
        Scanner in = new Scanner(System.in);
        System.out.println("请输入班级名称和指导老师:");
        n.clsName=in.next();
        n.dirTeacher=in.next();
        while (true) {
            System.out.println("1:新生报到，2：查找,3:输出全部信息，9：退出");

            int a = in.nextInt();
            if (a == 1) {
                System.out.println("请输入新生的名字：");
                String name=in.next();
                n.add(name);
            }
            else if (a == 2) {
                System.out.println("请输入要查找的学生姓名：");
                String name=in.next();
                System.out.println("再输入查找的起点和终点：");
                int start=in.nextInt();
                int end=in.nextInt();
                boolean flag = n.search2(name,start,end);
                System.out.println(flag?"在":"不在");
            }else if(a==3){
                n.showClsInfo();
            }else if(a==9){
                return;
            }
        }
    }
}
